<?php

// There are better ways to do this... I'know
define('FB_APP_ID', '124950474237644');
define('FB_SECRET', 'af843c2866b392d7fca944691022506c');
define('FB_API_KEY', '4407cb27592ab4df9d108f3d69582c44');
define('BASE_URL', 'http://www.dondejugarpaintball.com.ar/');

/*
  define('FB_TYPE_NAME_PRODUCT', 'product');
  define('FB_TYPE_NAME_FOOD', 'food');
  define('FB_TYPE_NAME_WEBSITE', 'website');

  define('PORTO_IMAGE_NAME', 'logo.gif');

 */
define('CURL_CA_CERT_PATH', APPLICATION_PATH . '/../library/Exts/Services/facebook/sdk/ca-bundle.crt');

static $_FB_ADMINS_ID = array(
'707962345'
);

static $_PERMS_NEEDED = array(
	'manage_pages',
	'publish_stream',
	'email'
);

require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/sdk/facebookLib.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/sdk/facebook_portobello.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/fb.facade.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/base.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/result.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/category.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/comment.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/status.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/link.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/feed.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/album.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/fb_category_map.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/ezpage_category_map.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/photo.php');
require_once (APPLICATION_PATH . '/../library/Exts/Services/facebook/model/from.php');

class FB {

	private static $_instance;

	private function __construct() {
		/* Do nothing */
	}

	private function __clone() {
		/* Do nothing */
	}

	public static function get_instance() {
		if (is_null(self::$_instance)) {
			$lib = new fb_portobello(array(
					'appId' => FbFacade::APP_ID,
					'secret' => FbFacade::SECRET,
					'cookie' => FbFacade::USE_COOKIE,
				));
			FacebookLib::$CURL_OPTS[CURLOPT_CONNECTTIMEOUT] = FbFacade::CURL_OPT_CONNECTTIMEOUT;
			FacebookLib::$CURL_OPTS[CURLOPT_CAINFO] = realpath(FbFacade::CA_CERT_PATH);
			FacebookLib::$CURL_OPTS[CURLOPT_TIMEOUT] = FbFacade::CURL_TIMEOUT;
			$lib->setThrowExceptions(FbFacade::THROW_EXCEPTION);
			$lib->setDecodeJson(FbFacade::DECODE_JSON);
			$lib->setSSLStatus(FbFacade::DISABLE_SSL_CHECK);
			$lib->allowFileUploads(FbFacade::ALLOW_FILE_UPLOADS);
			self::$_instance = $lib;
		}

		return self::$_instance;
	}

}